<template>
  <el-container>
    <el-header
      :style="{
        height: defaultHeadCom == 'headAssembly' ? '11.25rem' : '6rem',
      }"
    >
      <component :is="defaultHeadCom"></component>
    </el-header>
    <el-container>
      <el-aside>
        <menuList></menuList>
      </el-aside>
      <el-main>
        <template >
          <router-view
            ></router-view>
          <keep-alive>
            
          </keep-alive>
          <!-- <router-view  v-if="$route.path != '/quickConsultation'"></router-view> -->
        </template>
      
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
/* 
import myMenu from "@/components/home/myMenu.vue";
*/
import {login_infofn} from '@/request/api'
import headAssembly from "@/components/home/head.vue";
import menuList from "@/components/home/menu.vue";
import nurseHead from "@/components/home/nurse_head.vue";
export default {
  components: {
    headAssembly,
    menuList,
    nurseHead,
  },
  data() {
    return {
      defaultHeadCom: null,
    };
  },
  created() {
    if (this.$store.state.login_info.userType == "3") {
      this.defaultHeadCom = "headAssembly";
      this.updataInfo();
    } else if (this.$store.state.login_info.userType == "4") {
      this.defaultHeadCom = "nurseHead";
    }
  },
  methods: {
    //更新专家信息
    updataInfo() {
      login_infofn().then((res) => {
        this.$store.commit("SETLOGININFO", res.result);
      });
    },
  },
};
</script>
<style lang='less' scoped>
.el-container {
  width: 100%;
  min-height: calc(100vh - 11.25rem);
  box-sizing: border-box;
}
.el-header {
  background-image: url("../../assets/images/head/head.png");
  background-repeat: no-repeat;
  background-size: cover;
}
.el-aside {
  width: 13.625rem !important;
}
.el-main {
  width: 106.375rem;
  background-color: #f1f1f1;
}
</style>